import { request } from "./request";

export function getrolesList(){
    return request({
        method:'get',
        url:'/roles'
    })
}

export function removeRight(roleId, rolesId){
    return request({
        method:'delete',
        url:`roles/${roleId}/rights/${rolesId}`
    })
}

export function getRightAll(){
    return request({
        method:'get',
        url: `rights/tree`
    })
}

export function setUserRights(roleId, rids) {
    return request({
      method: 'post',
      url: `roles/${roleId}/rights`,
      data: {
        rids
      }
    })
  }